<template>
  <el-dialog
    ref="mapDialog"
    class="map-dialog"
    :title="title"
    :width="width"
    :visible.sync="isShow"
    :close-on-click-modal="false"
     @close="$emit('on-close')" 
  >
    <slot></slot>
  </el-dialog>
</template>

<script>
export default {
  props: {
    //   弹窗标题
    title: {
      type: String,
      default: "弹窗信息",
    },
    // 弹窗的宽度
    width: {
      type: String,
      default: "50%",
    },
    // 控制弹窗的显示与隐藏
    show: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      isShow: this.show,
    };
  },
  watch: {
    show(newVal, oldVal) {
      this.isShow = this.show;
    },
  },
};
</script>

<style>
</style>